/*******************************************************************************************
This file is part of iToday.

iToday is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

iToday is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with iToday.  If not, see <http://www.gnu.org/licenses/>.
* ------------------------------------------------------------------------------
*    PicturePanel.h - Class PicturePanel declaration
* ------------------------------------------------------------------------------
*    Revision History
*    Date                  Author         Activity ID               Activity Headline
*    2009-10-13            Congqin				none						initial
*    2009-10-14            CubeWang				none						Modify the class method name
*    2009-10-26            CubeWang				none						add Gesture
*******************************************************************************************/

#pragma once

class PicturePanel:virtual public PanelBase
{
private:

protected:

public:
    HDC			m_hMemoryDC ;
    HBITMAP		m_hMemoryBm ;
    LONG		m_hMemoryDC_Height;
    POINT		m_ptStartPointInMemDC;

    //////////////////////////////////////////////////////////////////////////
    ///Gesture and Animation
    int				m_nMaxXExtent;
    int				m_nMaxYExtent;
    //////////////////////////////////////////////////////////////////////////

    PicturePanel();
    BOOL InitMemoryDC() override;
    void DrawMemoryDC();
    BOOL Draw() override;
    void FillEmptyPlaceWithBlack();

    //////////////////////////////////////////////////////////////////////////
    ///Gesture and Animation
    void SnapBackToFrame();	//Stop Animation, bring the content back into the visible area
    HRESULT
    ProcessPanEnd(		//Processes the end gesture and figures out what physics engine animation is needed
        int     nTransitionSpeed,            // @parm Start speed of animation (relevant for flick end gesture). Must be a posative value
        DWORD   nTransitionAngle             // @parm Angle for start speed (relevant for flick end gesture)
    );
    BOOL ProcessAnimationTimer();
    BOOL ProcessPan(POINTS& pt);
    BOOL RecordLastPanPoint( POINTS& pt );
    BOOL CalculateStartPointInMemDC( POINTS& pt );
    //////////////////////////////////////////////////////////////////////////

    ~PicturePanel();
};
